export default function OperationHook(state: {
  menuList: TabBar.TabBarItem[];
  setActive: (index: number) => void;
}) {
  const { menuList, setActive } = state;
  const changeMenuIndexHandle = (index: number) => {
    setActive(index);
    uni.switchTab({
      url: menuList[index].path,
    });
  };
  return {
    changeMenuIndexHandle,
  };
}
